<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<link rel="stylesheet" th:href="@{/css/yw.css}">
<body class="hold-transition skin-blue sidebar-mini">
<!--任务状态修改模态框-->
<div class="modal fade" id="modal-update">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 id="modal-update-title" class="modal-title">设计任务状态编辑</h4>
            </div>
            <div class="modal-body" style="padding-bottom: 0px;">
                <form id="editForm" class="form-horizontal">
                    <input id="deptIdEdit" type="hidden" name="deptId"/>
                    <input id="proIdEdit" type="hidden" name="proId"/>
                    <input id="comTaskNameIdEdit" type="hidden" name="comTaskNameId"/>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">项目</label>
                        <div class="col-sm-10">
                            <input disabled style="width: 100%;" th:value="${name}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">状态</label>
                        <div class="col-sm-10">
                            <select id="statusEdit" class="form-control" name="status">
                                <option value="1" selected>未开始</option>
                                <option value="2">执行中</option>
                                <option value="3">已完成</option>
                                <!--<option value="4">不需要</option>-->
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">开始时间</label>
                        <div class="col-sm-10">
                            <input id="startTime" type="text" class="form-control datepicker" name="startTime"
                                   readonly="readonly" style="width: 100%;" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">结束时间</label>
                        <div class="col-sm-10">
                            <input id="endTime" type="text" class="form-control datepicker" name="endTime"
                                   readonly="readonly" style="width: 100%;" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">备注</label>
                        <div class="col-sm-10">
                            <textarea id="remark" name="remark" rows="3" style="width: 100%;"></textarea>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" shiro:hasPermission="dsn:proControl:edit" class="btn btn-info" id="btn-update-con">保存</button>
                <button type="button" shiro:hasPermission="dsn:proDebug:edit" class="btn btn-info" id="btn-update-deb">保存</button>
                <button type="button" shiro:hasPermission="dsn:proCost:edit" class="btn btn-info" id="btn-update-cost">保存</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--绩效备注-->
<div class="modal fade" id="modal-note">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">绩效备注</h4>
            </div>
            <div class="modal-body">
                <form id="noteForm" class="form-horizontal" role="form">
                    <input type="hidden" th:value="${id}" name="proId">
                    <div class="form-group">
                        <label class="col-sm-2 control-label no-padding-right">描述</label>
                        <div class="col-sm-10">
                            <textarea rows="3" class="form-control" name="performanceNote"
                                      th:text="${performanceNote}"></textarea>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button shiro:hasPermission="dsn:proMents:edit" type="button" class="btn btn-primary" id="btn-note">确定
                </button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!--文件上传下载模态框-->
<div class="modal fade" id="modal-upload">
    <div class="modal-dialog" style="width: 1240px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="modal-upload-title">控制意图文件</h4>
            </div>
            <div class="modal-body">
                <form id="intentForm" class="form-horizontal" role="form">
                    <div class="row" id="toolbarIntent">
                        <div class="form-inline">
                            <button type="button" id="btn-upload-intent" shiro:hasPermission="dsn:intent:upload"
                                    class="btn btn-info">
                                上传
                            </button>
                            <button type="button" id="btn-upload-proDebug" shiro:hasPermission="dsn:proDebug:upload"
                                    class="btn btn-info">
                                上传
                            </button>
                        </div>
                    </div>
                    <div class="row">
                        <table id="bootstrap-table-intent"></table>
                    </div>
                </form>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!--项目说明文件列表-->
<div class="modal fade" id="modal-explain">
    <div class="modal-dialog" style="width: 1240px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">项目说明文件</h4>
            </div>
            <div class="modal-body">
                <form id="explainForm" class="form-horizontal" role="form">
                    <div class="row" id="toolbarExplain">
                        <div class="form-inline">
                            <button type="button" id="btn_explainAdd" shiro:hasPermission="dsn:proexpla:edit"
                                    class="btn btn-info">
                                上传
                            </button>
                        </div>
                    </div>
                    <div class="row">
                        <input type="hidden" id="branchId">
                        <table id="bootstrap-table-explain"></table>
                    </div>
                </form>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!--产品部分状态列表-->
<div class="modal fade" id="modal-part">
    <div class="modal-dialog" style="width: 1240px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">设计任务状态编辑</h4>
            </div>
            <div class="modal-body">
                <input id="deptIdPart" type="hidden">
                <h4 style="margin-bottom: 25px;margin-top: 0px;">设计任务状态</h4>
                <form id="editTaskForm" class="form-horizontal">
                    <input type="hidden" name="deptId"/>
                    <input type="hidden" name="proId"/>
                    <input type="hidden" name="comTaskNameId"/>
                    <div class="row">
                        <div class="col-md-3">
                            <div class="form-group">
                                <label class="col-md-4 control-label">状态</label>
                                <div class="col-md-8">
                                    <select class="form-control" name="status">
                                        <option value="1" selected>未开始</option>
                                        <option value="2">执行中</option>
                                        <option value="3">已完成</option>
                                        <!--<option value="4">不需要</option>-->
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-md-4 control-label">开始时间</label>
                                <div class="col-md-8">
                                    <input type="text" class="form-control datepicker" name="startTime"
                                           readonly="readonly" style="width: 100%;" />
                                </div>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-md-4 control-label">结束时间</label>
                                <div class="col-md-8">
                                    <input type="text" class="form-control datepicker" name="endTime"
                                           readonly="readonly" style="width: 100%;" />
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-11">
                            <div class="form-group">
                                <label class="col-md-1 control-label" style="padding-top: 0px;padding-right: 8px;">备注</label>
                                <div class="col-md-11" style="padding-left: 23px;">
                                    <textarea name="remark" rows="3" style="width: 100%;"></textarea>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-1">
                            <button shiro:hasPermission="dsn:proNode:edit" style="display: none;" type="button" class="btn btn-info" id="btn-update-dsn">保存</button>
                        </div>
                    </div>
                </form>
                <hr>
                <h4>产品部分状态</h4>
                <div class="row">
                    <table id="bootstrap-table-part"></table>
                </div>
                <div id="tablePartEditDiv" class="row" style="display: none;margin-top: 20px;" shiro:hasPermission="dsn:proNode:edit">
                    <form id="editPartForm" class="form-horizontal">
                        <div class="col-md-6 col-md-offset-2" >
                        <div class="box">
                            <div class="box-header">
                                <h4>产品部分状态编辑</h4>
                            </div>
                            <div class="box-body">
                                <div class="row">
                                    <input type="hidden" name="proId">
                                    <input id="proPartId" type="hidden" name="id"/>
                                    <input type="hidden" name="comTaskNameId"/>
                                    <div class="form-group">
                                        <label class="col-md-3 control-label">项目</label>
                                        <div class="col-md-9">
                                            <input disabled style="width: 100%;" th:value="${name}">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md-3 control-label">部分</label>
                                        <div class="col-md-9">
                                            <input disabled style="width: 100%;" name="proPart">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md-3 control-label">状态</label>
                                        <div class="col-md-9">
                                            <select class="form-control" name="compStatus">
                                                <option value="1" selected>未开始</option>
                                                <option value="2">执行中</option>
                                                <option value="3">已完成</option>
                                                <option value="4">不需要</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md-3 control-label">备注</label>
                                        <div class="col-md-9">
                                            <textarea name="remark" rows="3" style="width: 100%;"></textarea>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="box-footer">
                                <button shiro:hasPermission="dsn:proNode:edit" type="button" class="btn btn-info pull-right" id="btn_create">保存</button>
                            </div>
                        </div>
                    </div>
                    </form>
                </div>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!--文件上传下载模态框（项目说明）-->
<div class="modal fade" id="modal-uploadExplain">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">上传文件</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-offset-1">
                        <form id="uploadFormExplain" method="post"
                              class="form-horizontal" role="form" enctype="multipart/form-data">
                            <input id="proIdExp" type="hidden" name="proId">
                            <input id="branchIdExp" type="hidden" name="branchId">
                            <div class="form-group" id="file_group"></div>
                            <div class="form-group">
                                <label for="upload_file">选择附件上传</label>
                                <input id="upload_fileExp" class="btn" type="file" name="file" style="padding-left: 0px;">
                                <p class="help-block">多个文件请自行打包上传，大小不要超过100M</p>
                            </div>
                            <div class="form-group">
                                <label class="control-label">描述</label>
                                <div class="row">
                                    <div class="col-md-12" style="padding-left: 0px;">
                                        <textarea rows="3" class="form-control" name="fileContent"
                                                  placeholder="描述"></textarea>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button  id="btn-uploadExp" type="button"
                        class="btn btn-success">
                    <span class="Bold">上传</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!--文件上传下载模态框（控制意图）-->
<div class="modal fade" id="modal-uploadIntent">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">上传文件</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-offset-1">
                        <form id="uploadFormInt" method="post"
                              class="form-horizontal" role="form" enctype="multipart/form-data">
                            <input id="proIdInt" type="hidden" name="proId">
                            <input id="fileType" type="hidden" name="fileType">
                            <div class="form-group" id="file_groupInt"></div>
                            <div class="form-group">
                                <label for="upload_file">选择附件上传</label>
                                <input id="upload_fileInt" class="btn" type="file" name="file" style="padding-left: 0px;">
                                <p class="help-block">多个文件请自行打包上传，大小不要超过100M</p>
                            </div>
                            <div class="form-group">
                                <label class="control-label">描述</label>
                                <div class="row">
                                    <div class="col-md-12" style="padding-left: 0px;">
                                        <textarea rows="3" class="form-control" name="fileContent"
                                                  placeholder="描述"></textarea>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button  id="btn-uploadInt" type="button"
                         class="btn btn-success">
                    <span class="Bold">上传</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!--文件描述修改模态框-->
<div class="modal fade" id="modal-updateExplain">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">修改文件描述</h4>
            </div>
            <div class="modal-body">
                <form id="editFormExplain" class="form-horizontal" role="form">
                    <input id="id" type="hidden" name="id">
                    <div class="form-group">
                        <label for="fileContent" class="col-sm-2 control-label no-padding-right">文件描述</label>
                        <div class="col-sm-10">
                            <textarea class="form-control" id="fileContent" name="fileContent" rows="3"></textarea>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-info" id="btn-updateExp">修改</button>
            </div>
        </div>
    </div>
</div>
<!--控制意图修改模态框-->
<div class="modal fade" id="modal-updateInt">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">修改文件描述</h4>
            </div>
            <div class="modal-body">
                <form id="editFormInt" class="form-horizontal" role="form">
                    <input id="idInt" type="hidden" name="id">
                    <div class="form-group">
                        <label for="fileContent" class="col-sm-2 control-label no-padding-right">文件描述</label>
                        <div class="col-sm-10">
                            <textarea class="form-control" id="fileContentInt" name="fileContent" rows="3"></textarea>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-info" id="btn-updateInt">修改</button>
            </div>
        </div>
    </div>
</div>
<section class="content-header">
    <h1>
        设计任务过程看板
    </h1>
    <a id="btn-tzrw" href="javascript:void(0);"
       class="btn btn-info pull-right" style="margin-right: 15px;margin-bottom: 15px"><span class="Bold">任务项编辑</span>
    </a>

</section>
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <div class="row">
                        <div class="form-inline">
                            <input type="hidden" id="proId" name="id" th:value="${id}">
                            <input type="hidden" id="proCode" name="proCode" th:value="${code}">
                            <div class="form-group" style="margin-right: 10px;">
                                <label>项目编号</label>
                                <input type="text" name="code" class="form-control text-center"
                                       style="border: none; border-bottom: solid 1px #EEEEEE;" th:value="${code}">
                            </div>
                            <div class="form-group" style="margin-right: 10px;">
                                <label>项目名称</label>
                                <input type="text" name="code" class="form-control text-center" th:value="${name}"
                                       style="border: none; border-bottom: solid 1px #EEEEEE;width:300px;">
                            </div>
                            <div class="form-group" style="margin-right: 10px;">
                                <label>项目数量</label>
                                <input type="text" name="code" class="form-control text-center" th:value="${num}"
                                       style="border: none; border-bottom: solid 1px #EEEEEE;width:100px;">
                            </div>
                            <div class="form-group" style="margin-right: 10px;">
                                <label>需方</label>
                                <input type="text" name="demander" th:value="${demander}"
                                       class="form-control text-center"
                                       style="border: none; border-bottom: solid 1px #EEEEEE;">
                            </div>
                            <div class="form-group" style="margin-right: 10px;">
                                <label>安装地点</label>
                                <input type="text" name="address" th:value="${address}" class="form-control text-center"
                                       style="border: none; border-bottom: solid 1px #EEEEEE;">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="box-body">
                    <table id="bootstrap-table"></table>
                    <div class="callout" style="margin-top: 10px;margin-bottom: 0px;"
                         shiro:hasPermission="dsn:proMents:edit">
                        <button type="button" id="btn_editNote"
                                class="btn btn-warning pull-right"> 绩效编辑
                        </button>
                        <h4>绩效备注</h4>
                        <p th:text="${performanceNote}"></p>
                    </div>
                </div>
                <div class="box-body" style=" background-color: #EBF4F9; min-height: 450px;">
                    <div id="divRight" class="hidden" style="background-color: #FFFFFF; width: 30px;text-align: center;
                     border: solid 1px #eee; cursor: pointer; float: left; height: 450px; line-height: 450px; margin: auto 0px; border-radius: 2px; "
                         onclick="rightDiv();">
                        <i class="fa fa-caret-right" style="color: #3C8DBC; font-size: 20px;"></i>
                    </div>
                    <div class="box" id="divLeft"
                         style="width:13%; float: left; height: 100%; min-height: 450px; min-width: 170px;">
                        <div class="box-header"
                             style="height: 60px; line-height: 40px; vertical-align: middle; text-align: center; ">
                            <i class="fa fa-list" style="color: #333; cursor: pointer; line-height: 20px; "
                               onclick="initZonglanDiv()">&nbsp;&nbsp;&nbsp;设计任务</i>
                            <div style="background-color: #F8F8F8; width: 20px;text-align: center; border: solid 1px #eee; cursor: pointer; float: right; height: 40px; line-height: 40px; margin: auto 0px; "
                                 onclick="leftDiv();">
                                <i class="fa fa-caret-left" style="color: #3C8DBC; font-size: 18px;"></i>
                            </div>
                        </div>
                        <div class="box-body" style="border-top: 1px solid #EEEEEE;">
                            <div id="proStruct-tree" class="ztree"></div>
                        </div>
                    </div>
                    <div class="box" style="width:85%; float: left; margin-left: 1%; min-height: 450px;" id="contetDiv">
                        <!--产品结构-->
                        <div id="jiegouDiv" style="display: none;">
                            <div class="box-header">
                                <h4 id="jiegouTitle">设计任务xxxx信息总览</h4>
                            </div>
                            <div class="box-body">
                                <div>
                                    <a id="outPageSel" th:href="@{/designTask/process/outPage}"
                                       shiro:hasPermission="dsn:prodetQuer:view"
                                       class="btn btn-info pull-right">查看详细</a>
                                    <h4 style="margin-bottom: 0px;margin-top: 0px;">外购件计划</h4>
                                    <table id="waigouTable"
                                           style="table-layout: fixed;word-break:break-all; word-wrap:break-word;"></table>
                                </div>
                                <div style="margin-top: 20px;">
                                    <a id="makePageSel" th:href="@{/designTask/process/makePage}"
                                       shiro:hasPermission="dsn:prodetQuer:view"
                                       class="btn btn-info pull-right">查看详细</a>
                                    <h4 style="margin-bottom: 0px;margin-top: 0px;">制作件计划</h4>
                                </div>
                                <table id="zhizuoTable"
                                       style="table-layout: fixed;word-break:break-all; word-wrap:break-word;"></table>
                                <div style="margin-top: 20px;">
                                    <a id="drawPageSel" th:href="@{/designTask/process/drawPage}"
                                       shiro:hasPermission="dsn:prodetQuer:view"
                                       class="btn btn-info pull-right">查看详细</a>
                                    <h4 style="margin-bottom: 0px;margin-top: 0px;">图纸变更单</h4>
                                </div>
                                <table id="tubiangengTable"
                                       style="table-layout: fixed;word-break:break-all; word-wrap:break-word;"></table>
                                <div style="margin-top: 20px;display: none">
                                    <a th:href="@{/tecout/tecnote/queryList}"
                                       shiro:hasPermission="dsn:prodetQuer:view"
                                       class="btn btn-info pull-right">查看详细</a>
                                    <h4 style="margin-bottom: 0px;margin-top: 0px;">技术说明</h4>
                                </div>
                                <div style="display: none">
                                    <table id="tecNoteTable"
                                           style="table-layout: fixed;word-break:break-all; word-wrap:break-word;"></table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </div>
</section>
<div th:include="include :: footer"></div>

<script th:inline="javascript">
    // 被格式化还原留用
    // var downhref = [[@{/designTask/conInt/download}]] + "?proCode=" + [[${code}]];
    var downhref = [[@{/designTask/conInt/download}]] + "?proCode=" + [[${code}]];

    var proStructTree;
    var table, table1, table2, table3, tableExplain, tablePart, tableIntent;
    var statusName = ["", "未开始", "执行中", "已完成", "不需要"];
    var classType = ["", " label-default", " label-warning", " label-success", " label-primary"];
    var statusColor = ["", "", "#f39c12", "#00a65a", "#00acd6"];
    var outPageSelUrl = $("#outPageSel").attr("href");
    var makePageSelUrl = $("#makePageSel").attr("href");
    var drawPageSelUrl = $("#drawPageSel").attr("href");

    function rightDiv() {
        $("#divRight").addClass("hidden");
        $("#divLeft").removeClass("hidden");
        $("#contetDiv").css("width", "85%");
    }

    function leftDiv() {
        $("#divLeft").addClass("hidden");
        $("#divRight").removeClass("hidden");
        $("#contetDiv").css("width", "95%");
    }
    /** 任务页面查询*/
    $("#btn-tzrw").click(function(){
        let proCode = $("#proCode").val();
        var urlTzrw = ctx + "designTask/process/tzrwList?proCode="+proCode;
        window.open(urlTzrw,"_blank");
    })

    /**
     * 合并单元格
     * @param data 原始数据（在服务端完成排序）
     * @param fieldName 合并依据属性名称
     * @param spanFieldName 合并属性名称
     * @param colspan 合并列
     * @param target 目标表格对象
     */
    function mergeCells(data, fieldName, spanFieldName, colspan, target) {
        //声明一个map计算相同属性值在data对象出现的次数和
        var sortMap = {};
        for (var i = 0; i < data.rows.length; i++) {
            for (var prop in data.rows[i]) {
                if (prop == fieldName) {
                    var key = data.rows[i][prop]
                    if (sortMap.hasOwnProperty(key)) {
                        sortMap[key] = sortMap[key] * 1 + 1;
                    } else {
                        sortMap[key] = 1;
                    }
                    break;
                }
            }
        }
        var index = 0;
        for (var prop in sortMap) {
            var count = sortMap[prop] * 1;
            $(target).bootstrapTable('mergeCells', {
                index: index,
                field: spanFieldName,
                colspan: colspan,
                rowspan: count
            });
            index += count;
        }
    }

    /** 任务状态编辑模态框(设计) */
    function editStatusDes(result, taskType) {
        // 部分列表
        $("#deptIdPart").val(result.deptId);
        initTablePart(result.proId,result.deptId);
        // 科室任务状态
        initDeptTask(result.proId,result.deptId);
        // 控制保存按钮显隐
        if ((result.deptId == sessionUser.deptId) || (sessionUser.account == "admin")){
            $("#btn-update-dsn").show();
        }
        js.modal.open("modal-part");
    }

    /** 任务状态编辑模态框 */
    function editStatus(result, taskType) {
        var url;
        if (taskType == 6){
            url = "designTask/process/nodeConStatus";
        } else {
            url = "designTask/process/nodeStatus";
        }

        // 保存按钮控制
        if (taskType == 6) {
            $("#btn-update-con").show();
            $("#btn-update-deb").hide();
            $("#btn-update-cost").hide();
        }else if (taskType == 7){
            $("#btn-update-con").hide();
            $("#btn-update-deb").hide();
            $("#btn-update-cost").show();
            if ((!(sessionUser.deptId == result.deptId) || !hasP('dsn:proCost:edit')) && (sessionUser.account != "admin")){
                $("#remark").attr('disabled', true);
                $("#statusEdit").attr('disabled', true);
                $("#btn-update-cost").hide();
            }
        } else if (taskType == 8){
            $("#btn-update-con").hide();
            $("#btn-update-deb").show();
            $("#btn-update-cost").hide();
            if ((!(sessionUser.deptId == result.deptId) || !hasP('dsn:proCost:edit')) && (sessionUser.account != "admin")){
                $("#remark").attr('disabled', true);
                $("#statusEdit").attr('disabled', true);
                $("#btn-update-deb").hide();
            }
        }

        // 取得任务节点信息
        js.post({
            url: ctx + url,
            data: {deptId: result.deptId,proId:result.proId,comTaskNameId:taskType},
            success: function (result) {
                if (result.type === web_status.SUCCESS) {
                    // 任务状态编辑模态框数据源绑定
                    bindEditForm(result, taskType, result.data);
                } else {
                    js.modal.warning(result.msg);
                }
            }
        })
    }

    /** 任务状态编辑模态框数据源绑定 */
    function bindEditForm(result, taskType, data) {
        $("#editForm").fillData(data);
        if (taskType == 6) {
            $("#modal-update-title").text("控制意图任务状态编辑");
            js.modal.open("modal-update");
        } else if (taskType == 7) {
            $("#modal-update-title").text("成本任务状态编辑");
            js.modal.open("modal-update");
        } else if (taskType == 8) {
            $("#modal-update-title").text("调试任务状态编辑");
            js.modal.open("modal-update");
        }
    }

    /** 打开项目说明模态框 */
    function openExplain(row) {
        $("#branchId").val(row.deptId);
        // 加载项目说明文件列表
        initTableExplain(row.proId,row.deptId);
        js.modal.open("modal-explain");
    }

    /** 重新加载项目说明文件列表 */
    function initTableExplain(proId,branchId){
        // 加载表格
        tableExplain = js.table.init({
            url: ctx + "designTask/process/explainList",
            id: "bootstrap-table-explain",
            showExport: false,
            pagination: false,
            toolbar: '#toolbarExplain',
            queryData: {
                proId: proId,
                branchId: branchId
            },
            columns: [
                {
                    title: '序号', field: 'id', width: '50',
                    formatter: function (value, row, index) {
                        return index + 1;
                    }
                },
                {title: "文件名", field: 'fileName'},
                {title: "内容", field: 'fileContent'},
                {title: "上传人", field: 'createName', width: 100},
                {title: "上传时间", field: 'createTime', width: 110},
                {
                    title: "操作", field: 'url', width: 150,
                    formatter: function (value, row) {
                        let actions = [];
                        if (hasP('dsn:proexpla:download')) {
                            actions.push('<a class="btn btn-primary btn-xs" href="' + value + '">下载</a> ');
                        }
                        if (hasP('dsn:proexpla:edit') && sessionUser.account === row.createCode) {
                            actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="openEditExp(' + js.jsonStringify(row) + ')"> 编辑</a> ');
                        }
                        if (hasP('dsn:proexpla:del') && sessionUser.account === row.createCode) {
                            actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="delExp(' + row.id + ')"> 删除</a>');
                        }
                        return actions.join('');
                    }
                }
            ]
        });
    }

    /** 重新加载控制意图文件列表 */
    function initTableIntent(proCode,fileType){
        // 加载表格
        tableIntent = js.table.init({
            url: ctx + "designTask/process/intentFileList",
            id: "bootstrap-table-intent",
            showExport: false,
            pagination: false,
            toolbar: '#toolbarIntent',
            queryData: {
                proCode: proCode,
                fileType: fileType
            },
            columns: [
                {
                    title: '序号', field: 'id', width: '50',
                    formatter: function (value, row, index) {
                        return index + 1;
                    }
                },
                {title: "文件名", field: 'fileName'},
                {title: "内容", field: 'fileContent'},
                {title: "上传人", field: 'createName', width: 100},
                {title: "上传时间", field: 'createTime', width: 110},
                {
                    title: "操作", field: 'url', width: 150,
                    formatter: function (value, row) {
                        let actions = [];
                        if (hasP('dsn:intent:print')) {
                            actions.push('<a class="btn btn-primary btn-xs" href="' + value + '">下载</a> ');
                        }
                        if (hasP('dsn:intent:upload') && sessionUser.account === row.createCode && fileType == 1) {
                            actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="openEditInt(' + js.jsonStringify(row) + ')"> 编辑</a> ');
                        }
                        if (hasP('dsn:intent:delFile') && sessionUser.account === row.createCode && fileType == 1) {
                            actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="delInt(' + js.jsonStringify(row) + ')"> 删除</a>');
                        }
                        if (hasP('dsn:proDebug:upload') && sessionUser.account === row.createCode && fileType == 3) {
                            actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="openEditInt(' + js.jsonStringify(row) + ')"> 编辑</a> ');
                        }
                        if (hasP('dsn:proDebug:delFile') && sessionUser.account === row.createCode && fileType == 3) {
                            actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="delInt(' + js.jsonStringify(row) + ')"> 删除</a>');
                        }
                        return actions.join('');
                    }
                }
            ]
        });
    }

    /** 重新加载项目部分列表 */
    function initTablePart(proId,deptId){
        // 加载表格
        tablePart = js.table.init({
            onLoadSuccess: function (data) {
                mergeCells(data, "special", "special", 1, $('#bootstrap-table-part')); //合并单元格
            },
            url: ctx + "designTask/process/partList",
            id: "bootstrap-table-part",
            showExport: false,
            pagination: false,
            queryData: {
                proId: proId,
                deptId: deptId
            },
            columns: [
                {
                    title: '序号', field: 'id', width: '50',
                    formatter: function (value, row, index) {
                        return index + 1;
                    }
                },
                {title: "专业", field: 'special'},
                {title: "部分", field: 'proPart'},
                {title: "状态", field: 'compStatus',
                    formatter: function (value, row) {
                        return statusName[value];
                    },
                    cellStyle: function (value) {
                        return {css: {"background-color": statusColor[value]}}
                    }
                },
                {title: "备注", field: 'remark'},
                {title: "编辑科室", field: 'deptName'},
                {
                    title: "操作", width: 100,
                    formatter: function (value, row) {
                        let actions = [];
                        if (hasP('dsn:proNode:edit') && (deptId == sessionUser.deptId || sessionUser.account == "admin")) {
                            actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="openEditPart(' + js.jsonStringify(row) + ')"> 编辑</a> ');
                        }
                        return actions.join('');
                    }
                }
            ]
        });
    }

    /** 重新加载科室项目任务状态 */
    function initDeptTask(proId,deptId) {
        // 取得任务节点信息
        js.post({
            url: ctx + "designTask/process/nodeStatus",
            data: {deptId: deptId,proId:proId,comTaskNameId:5},
            success: function (result) {
                if (result.type === web_status.SUCCESS) {
                    // 任务状态编辑模态框数据源绑定
                    $("#editTaskForm").fillData(result.data);
                } else {
                    js.modal.warning(result.msg);
                }
            }
        })
    }

    /** 删除数据项目说明 */
    function delExp(id) {
        js.modal.confirm("确认删除吗？", function () {
            js.post({
                url: ctx + "designTask/process/delExp",
                data: {id: id},
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success(result.msg);
                        // 加载项目说明文件列表
                        js.table.destroy(tableExplain);
                        initTableExplain($("#proId").val(),$("#branchId").val());
                        js.table.refresh(table);
                    } else {
                        js.modal.warning(result.msg);
                    }
                }
            })
        })
    }

    /** 删除数据控制意图 */
    function delInt(rowData) {
        js.modal.confirm("确认删除吗？", function () {
            js.post({
                url: ctx + "designTask/process/delExp",
                data: {id: rowData.id},
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success(result.msg);
                        // 加载项目说明文件列表
                        js.table.destroy(tableIntent);
                        initTableIntent($("#proCode").val(),rowData.fileType);
                        js.table.refresh(table);
                        if (rowData.fileType == 1){
                            let a = $("#conIntLb").text().split(":");
                            let b =parseInt(a[1])-1;
                            $("#conIntLb").text("已上传:"+b);
                        } else if (rowData.fileType == 3){
                            let a = $("#conDebLb").text().split(":");
                            let b =parseInt(a[1])-1;
                            $("#conDebLb").text("已上传:"+b);
                        }
                    } else {
                        js.modal.warning(result.msg);
                    }
                }
            })
        })
    }

    /** 打开编辑模态框 */
    function openEditExp(result) {
        $("#id").val(result.id);
        $("#fileContent").val(result.fileContent);
        js.modal.open("modal-updateExplain");
    }

    /** 打开编辑模态框 */
    function openEditInt(result) {
        $("#idInt").val(result.id);
        $("#fileContentInt").val(result.fileContent);
        js.modal.open("modal-updateInt");
    }

    /** 打开编辑模态框（部分状态） */
    function openEditPart(result) {
        $("#tablePartEditDiv").show();
        $("#editPartForm").fillData(result);
    }

    $(function () {

        /** 项目任务进度 */
        table = js.table.init({
            url: ctx + "designTask/process/taskStatus",
            onLoadSuccess: function (data) {
                mergeCells(data, "proId", "secondStatus", 1, $('#bootstrap-table')); //合并单元格
            },
            showExport: false,
            pagination: false,
            queryData: {
                proId: $("#proId").val(),
            },
            columns: [
                {title: "任务科室", field: 'deptName',width:'200'},
                {
                    title: "设计任务", field: 'firstStatus',
                    formatter: function (value, row) {
                        var comCount = row.comPartCount + "/" + row.allPartCount;

                        var actions = [];
                        actions.push('<a style="display: block;height: 100%;width: 100%;" href="javascript:void(0)" ' +
                            'onclick="editStatusDes(' + js.jsonStringify(row) + ',5)"><span class="badge'+ classType[value] +'">' + statusName[value] + '</span>&nbsp;&nbsp;&nbsp; ' +
                            '<span style="color: red;">' + comCount + '</span></a>');
                        return actions.join('');
                    }
                },
                {
                    title: "控制意图<a class='btn-success btn-xs btn pull-right' style='margin-left: 10px;' href='javascript:void(0)' id='btn-upload'>文件</a> <lable id='conIntLb' class='pull-right' style='font-size: 0.5em'>已上传:[[${filesCount}]]</lable>"
                    , field: 'secondStatus', width: 300,
                    formatter: function (value, row) {
                        var actions = [];
                        actions.push('<a style="display: block;height: 100%;width: 100%;" href="javascript:void(0)" ' +
                            'onclick="editStatus(' + js.jsonStringify(row) + ',6)"><span class="badge'+ classType[value] +'">' + statusName[value] + '</span></a>');
                        return actions.join('');
                    }
                },
                {
                    // 20110630 上传功能暂时注掉，原因：与生产系统冲突
                    // title: "调试任务<a class='btn-success btn-xs btn pull-right' style='margin-left: 10px;' href='javascript:void(0)' id='btn-upload-debug'>文件</a> <lable id='conDebLb' class='pull-right' style='font-size: 0.5em'>已上传:[[${filesDebugCount}]]</lable>"
                    title: "调试任务"
                    , field: 'fourthStatus', width: 300,
                    formatter: function (value, row) {
                        var actions = [];
                        actions.push('<a style="display: block;height: 100%;width: 100%" href="javascript:void(0)" ' +
                            'onclick="editStatus(' + js.jsonStringify(row) + ',8)"><span class="badge'+ classType[value] +'">' + statusName[value] + '</span></a>');
                        return actions.join('');
                    }
                },
                {
                    title: "成本输出", field: 'thirdStatus',
                    formatter: function (value, row) {
                        var actions = [];
                        actions.push('<a style="display: block;height: 100%;width: 100%;" href="javascript:void(0)" ' +
                            'onclick="editStatus(' + js.jsonStringify(row) + ',7)"><span class="badge'+ classType[value] +'">' + statusName[value] + '</span></a>');
                        return actions.join('');
                    }
                },
                {
                    title: "项目说明", width:'150',
                    formatter: function (value, row) {
                        let actions = [];
                        actions.push('<span> 文件数:'+ row.expCount +'</span> ');
                        if (hasP('dsn:proexpla:view')) {
                            actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="openExplain(' + js.jsonStringify(row) + ')"> 文件</a> ');
                        }
                        return actions.join('');
                    }
                }
            ]
        });

        /** 关闭模态框 */
        js.modal.hideEvent("modal-update", function () {
            js.reset("editForm");
            $("#remark").attr('disabled', false);
            $("#statusEdit").attr('disabled', false);
        });

        /** 控制‘已上传：’文字显隐 */
        if ([[${filesCount}]] == 0) {
            $("#conIntLb").hide();
        }
        if ([[${filesDebugCount}]] == 0) {
            $("#conDebLb").hide();
        }

        /** 加载左侧产品结构数据 */
        queryProStruceTree();

        /** 初始化时候就执行 */
        initZonglanDiv("", "");

        /** 修改任务状态 */
        $("#btn-update-con,#btn-update-deb,#btn-update-cost").click(function () {
            js.validSubmit({
                formId: "editForm",
                url: ctx + "designTask/process/editTaskStatus",
                data: new FormData($("#editForm")[0]),
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success(result.msg);
                        js.table.refresh(table);
                        js.modal.hide("modal-update");
                    } else {
                        js.modal.warning(result.msg);
                    }
                }
            });
        });

        /** 修改任务状态 */
        $("#btn-update-dsn").click(function () {
            js.validSubmit({
                formId: "editTaskForm",
                url: ctx + "designTask/process/editTaskStatus",
                data: new FormData($("#editTaskForm")[0]),
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success(result.msg);
                        js.table.refresh(table);
                    } else {
                        js.modal.warning(result.msg);
                    }
                }
            });
        });

        /** 项目部分状态编辑 */
        $("#btn_create").click(function () {

            if ($("#proPartId").val() == ""){
                js.modal.warning("请先选择要编辑的部分！");
                return;
            }
            js.validSubmit({
                formId: "editPartForm",
                url: ctx + "designTask/process/editPartStatus",
                data: new FormData($("#editPartForm")[0]),
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.reset("editPartForm");
                        js.modal.success(result.msg);
                        js.table.refresh(table);
                        // 重新加载项目部分列表
                        js.table.destroy(tablePart);
                        initTablePart($("#proId").val(),$("#deptIdPart").val());
                    } else {
                        js.modal.warning(result.msg);
                    }
                }
            });
        });

        /** 绩效备注 */
        $("#btn_editNote").click(function () {
            js.modal.open("modal-note")
        });

        /** 创建或编辑绩效备注 */
        $("#btn-note").click(function () {
            js.validSubmit({
                formId: "noteForm",
                url: ctx + "designTask/process/note",
                data: new FormData($("#noteForm")[0]),
                success: function () {
                    location.reload();
                }
            });
        })

        /** 控制意图上传 */
        $("#btn-upload").click(function () {
            $("#fileType").val(1);
            $("#modal-upload-title").text("控制意图文件");
            $("#btn-upload-proDebug").hide();
            if (hasP('dsn:intent:upload')){
                $("#btn-upload-intent").show();
            }
            // 加载控制意图文件列表
            initTableIntent($("#proCode").val(),1);
            js.modal.open("modal-upload")
        });

        /** 调试任务上传 */
        $("#btn-upload-debug").click(function () {
            $("#fileType").val(3);
            $("#modal-upload-title").text("调试任务文件");
            $("#btn-upload-intent").hide();
            if (hasP('dsn:proDebug:upload')){
                $("#btn-upload-proDebug").show();
            }
            // 加载控制意图文件列表
            initTableIntent($("#proCode").val(),3);
            js.modal.open("modal-upload")
        });

        /** 关闭模态框（项目说明列表） */
        js.modal.hideEvent("modal-explain", function () {
            js.table.destroy(tableExplain);
            js.reset("explainForm");
        });
        /** 关闭模态框（控制意图文件列表） */
        js.modal.hideEvent("modal-upload", function () {
            js.table.destroy(tableIntent);
        });

        /** 关闭模态框（项目部分列表） */
        js.modal.hideEvent("modal-part", function () {
            js.table.destroy(tablePart);
            js.reset("editPartForm");
            $("#deptIdPart").val("");
            $("#tablePartEditDiv").hide();
            $("#btn-update-dsn").hide();
        });

        /** 打开上传模态框（项目说明） */
        $("#btn_explainAdd").click(function () {
            $("#proIdExp").val($("#proId").val());
            $("#branchIdExp").val($("#branchId").val());
            js.modal.open('modal-uploadExplain');
        });

        /** 打开上传模态框（控制意图） */
        $("#btn-upload-intent,#btn-upload-proDebug").click(function () {
            $("#proIdInt").val($("#proId").val());
            js.modal.open('modal-uploadIntent');
        });

        /** 导入模态框隐藏事件，重置表单，重置验证（项目说明） */
        js.modal.hideEvent("modal-uploadExplain", function () {
            js.reset("uploadFormExplain");
        });

        /** 导入模态框隐藏事件，重置表单，重置验证（控制意图） */
        js.modal.hideEvent("modal-uploadIntent", function () {
            let fileType = $("#fileType").val();
            js.reset("uploadFormInt");
            $("#fileType").val(fileType);
        });

        /** 附件上传（项目说明） */
        $("#btn-uploadExp").click(function () {

            var file = $("#uploadFormExplain [name='file']").get(0).files[0];

            if (!file) {
                js.modal.warning("请选择要上传的文件");
                return;
            }

            if (file) {
                var sizeToMB = (file.size / 1024 / 1024).toFixed(2);
                if (sizeToMB > 100) {
                    js.modal.warning("上传文件大小不可超过100MB");
                    return;
                }
            }

            js.post({
                url: ctx + "designTask/process/uploadFileExp",
                data: new FormData($("#uploadFormExplain")[0]),
                contentType: false,
                processData: false,
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success("上传成功！");
                        // 加载项目说明文件列表
                        js.table.destroy(tableExplain);
                        initTableExplain($("#proId").val(),$("#branchId").val());
                        js.table.refresh(table);
                        js.modal.hide("modal-uploadExplain");
                    }
                }
            });
        });

        /** 附件上传（控制意图） */
        $("#btn-uploadInt").click(function () {

            var file = $("#uploadFormInt [name='file']").get(0).files[0];

            if (!file) {
                js.modal.warning("请选择要上传的文件");
                return;
            }

            if (file) {
                var sizeToMB = (file.size / 1024 / 1024).toFixed(2);
                if (sizeToMB > 100) {
                    js.modal.warning("上传文件大小不可超过100MB");
                    return;
                }
            }

            js.post({
                url: ctx + "designTask/conInt/uploadFile",
                data: new FormData($("#uploadFormInt")[0]),
                contentType: false,
                processData: false,
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success("上传成功！");
                        // 加载控制意图文件列表
                        js.table.destroy(tableIntent);
                        initTableIntent($("#proCode").val(),$("#fileType").val());
                        js.table.refresh(table);
                        js.modal.hide("modal-uploadIntent");
                        if ($("#fileType").val() == "1") {
                            let a = $("#conIntLb").text().split(":");
                            let b =parseInt(a[1])+1;
                            $("#conIntLb").text("已上传:"+b);
                            $("#conIntLb").show();
                        } else if ($("#fileType").val() == "3") {
                            let a = $("#conDebLb").text().split(":");
                            let b =parseInt(a[1])+1;
                            $("#conDebLb").text("已上传:"+b);
                            $("#conDebLb").show();
                        }
                    }
                }
            });
        });

        /** 修改描述（项目说明） */
        $("#btn-updateExp").click(function () {
            js.validSubmit({
                formId: "editFormExplain",
                url: ctx + "designTask/process/updExp",
                data: new FormData($("#editFormExplain")[0]),
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success(result.msg);
                        // 加载项目说明文件列表
                        js.table.destroy(tableExplain);
                        initTableExplain($("#proId").val(),$("#branchId").val());
                        js.modal.hide("modal-updateExplain");
                    } else {
                        js.modal.warning(result.msg);
                    }
                }
            });
        });

        /** 修改描述（控制意图） */
        $("#btn-updateInt").click(function () {
            js.validSubmit({
                formId: "editFormInt",
                url: ctx + "designTask/process/updExp",
                data: new FormData($("#editFormInt")[0]),
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success(result.msg);
                        // 加载控制意图文件列表
                        js.table.destroy(tableIntent);
                        initTableIntent($("#proCode").val(),$("#fileType").val());
                        js.modal.hide("modal-updateInt");
                    } else {
                        js.modal.warning(result.msg);
                    }
                }
            });
        });

        /** 隐藏模态框（项目说明修改） */
        js.modal.hideEvent("modal-updateExplain", function () {
            js.reset("editFormExplain");
        });

        /** 隐藏模态框（控制意图修改） */
        js.modal.hideEvent("modal-updateInt", function () {
            js.reset("editFormInt");
        });

    });

    /** 加载左侧产品结构数据 */
    function queryProStruceTree() {

        proStructTree = js.tree.init({
            id: "proStruct-tree",
            async: {
                url: ctx + "designTask/process/proStruct/" + $("#proId").val(),
            },
            check: {
                enable: false,                                                 // 是否显示多选框
            },
            data: {
                key: {
                    name: "proName"        // 节点数据保存节点名称的属性名称
                }
            },
            onClick: zTreeOnClick,
            beforeClick: zTreeBeforeClick
        });

        /** 展开左侧产品结构数据 */
        setTimeout(function () {
            proStructTree.expandAll(true);
        }, 500);

        /** 左侧产品树节点点击事件 */
        function zTreeOnClick(event, treeId, treeNode) {

            var parentName = "";
            if (treeNode.getParentNode() != null) {
                parentName = treeNode.getParentNode().proName;
            }
            readData(treeNode.proName, parentName);
        };

        function zTreeBeforeClick() {
            return true;
        };

    };

    /** 右侧列表加载 */
    function readData(paramType, parentName) {

        /** 左侧计划表单数据加载 */
        initSheetTable(paramType, parentName);
    }

    /** 设计任务总览 */
    function initZonglanDiv() {
        initSheetTable("", "");
    }

    /** 左侧计划表单数据加载 */
    function initSheetTable(paramType, parentName) {
        $("#jiegouTitle").html("设计任务" + paramType + "信息总览");
        $("#jiegouDiv").show();

        /** 加载外购件列表 */
        $('#waigouTable').bootstrapTable('destroy');
        table1 = js.table.init({
            id: "waigouTable",
            url: ctx + "designTask/process/buyList",
            queryData: {
                proCode: $("#proCode").val(),
                proPart: paramType,
                special: parentName
            },
            showExport: false,
            pagination: false,
            columns: [
                {
                    title: '序号', field: 'id', width: '50',
                    formatter: function (value, row, index) {
                        return index + 1;
                    }
                },
                {title: "部分", field: 'proPart'},
                {title: "类型", field: 'special'},
                {title: "科室", field: 'dept'},
                {title: "任务类型", field: 'task'},
                {title: "单据类型", field: 'billType'},
                {title: "提报人", field: 'createName'},
                {title: "提报日期", field: 'createTime'}
            ]
        });

        /** 加载制作件列表 */
        $('#zhizuoTable').bootstrapTable('destroy');
        table2 = js.table.init({
            id: "zhizuoTable",
            url: ctx + "designTask/process/makeList",
            queryData: {
                proCode: $("#proCode").val(),
                proPart: paramType,
                special: parentName
            },
            showExport: false,
            pagination: false,
            columns: [
                {
                    title: '序号', field: 'id', width: '50',
                    formatter: function (value, row, index) {
                        return index + 1;
                    }
                },
                {title: "部分", field: 'proPart'},
                {title: "类型", field: 'special'},
                {title: "科室", field: 'dept'},
                {title: "任务类型", field: 'task'},
                {title: "单据类型", field: 'billType'},
                {title: "提报人", field: 'createName'},
                {title: "提报日期", field: 'createTime'}
            ]
        });

        /** 加载制作件列表 */
        $('#tubiangengTable').bootstrapTable('destroy');
        table3 = js.table.init({
            id: "tubiangengTable",
            url: ctx + "designTask/process/drawChangeList",
            queryData: {
                proCode: $("#proCode").val(),
                proPart: paramType,
                special: parentName
            },
            showExport: false,
            pagination: false,
            columns: [
                {
                    title: '序号', field: 'id', width: '50',
                    formatter: function (value, row, index) {
                        return index + 1;
                    }
                },
                {title: "部分", field: 'proPart'},
                {title: "类型", field: 'special'},
                {title: "科室", field: 'dept'},
                {title: "任务类型", field: 'task'},
                {title: "单据类型", field: 'billType'},
                {title: "提报人", field: 'createName'},
                {title: "提报日期", field: 'createTime'}
            ]
        });

        var proCode = $("#proCode").val();
        var outPageHref = outPageSelUrl + "?proCode=" + proCode + "&proPart=" + paramType + "&special=" + parentName
        $("#outPageSel").attr("href", outPageHref);

        var makePageHref = makePageSelUrl + "?proCode=" + proCode + "&proPart=" + paramType + "&special=" + parentName
        $("#makePageSel").attr("href", makePageHref);

        var drawPageHref = drawPageSelUrl + "?proCode=" + proCode + "&proPart=" + paramType + "&special=" + parentName
        $("#drawPageSel").attr("href", drawPageHref);

    }

</script>
</body>
</html>
